#ifndef _XGAB_H_
#define _XGAB_H_

#include "xgba_p.h"

PACKED struct xgba_dma_cnt_t{
    uint16_t    nused:5;
    #define DMA_INC 0
    #define DMA_DEC 1
    #define DMA_FIXED 2
    #define DMA_RELOAD 3
    #define DMA_PROHIBITED 3
    uint16_t    dest_add:2;
    uint16_t    src_add:2;
    #define DMA_REPEAT_OFF 0
    #define DMA_REPEAT_ON 1
    uint16_t    dma_repeat:1;
    #define DMA_16BIT 0
    #define DMA_32BIT 1
    uint16_t    dma_32bit:1;

    #define DMA_DRQ 1
    uint16_t    game_pak_drq:1;

    #define DMA_START_IMM 0
    #define DMA_START_VBLANK 1
    #define DMA_START_HBLANK 2
    #define DMA_START_SPECIAL 3
    uint16_t    dma_start_timing:2; //从何时开始dma
    uint16_t    irq_end:1;      //当结束后是否执行irq
    uint16_t    dma_enable:1;   //启动dma;
};

#endif
